package org.wesc.boot.dao.entity;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.wesc.boot.common.easyexcel.LocalDateTimeConverter;
import org.wesc.boot.common.easyexcel.LongToStringConverter;

/**
 * <p>
 * 
 * </p>
 *
 * @author Wesley
 * @since 2019-12-09
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("sys_role")
public class Role extends Model<Role> {

    private static final long serialVersionUID = 1L;

    /**
     * 角色ID
     */
    @TableId(value = "ROLE_ID", type = IdType.AUTO)
    @ExcelProperty(value = {"角色ID"}, index = 0, converter = LongToStringConverter.class)
    @ColumnWidth(15)
    private Long roleId;

    /**
     * 角色名称
     */
    @ExcelProperty(value = {"角色名称"}, index = 1)
    @ColumnWidth(20)
    private String roleName;

    /**
     * 角色描述
     */
    @ExcelProperty(value = {"角色描述"}, index = 2)
    @ColumnWidth(20)
    private String remark;

    /**
     * 创建时间
     */
    @ExcelProperty(value = {"创建时间"}, index = 3, converter = LocalDateTimeConverter.class)
    @ColumnWidth(30)
    private LocalDateTime createTime;

    /**
     * 修改时间
     */
    @ExcelIgnore
    private LocalDateTime modifyTime;


    public static final String ROLE_ID = "ROLE_ID";

    public static final String ROLE_NAME = "ROLE_NAME";

    public static final String REMARK = "REMARK";

    public static final String CREATE_TIME = "CREATE_TIME";

    public static final String MODIFY_TIME = "MODIFY_TIME";

    @Override
    protected Serializable pkVal() {
        return this.roleId;
    }

}
